;; (when (not (and (>= emacs-major-version 23) window-system))
;;   (set-language-environment "UTF-8"))
;; (set-language-environment "utf-8")
;; (set-terminal-coding-system 'utf-8)
;; (set-keyboard-coding-system 'utf-8)
;; (prefer-coding-system 'utf-8)
;; (setq default-buffer-file-coding-system 'utf-8)
(if (equal window-system 'w32)
    '(progn
       (set-language-environment 'chinese-gbk)
       (set-terminal-coding-system 'chinese-gbk)
       (set-selection-coding-system 'chinese-gbk)
       (set-keyboard-coding-system 'chinese-gbk)
       (prefer-coding-system 'chinese-gbk)
       (setq default-buffer-file-coding-system 'chinese-gbk)))
(defun revert-buffer-with-coding-system-no-confirm (coding-system)
  (interactive "zCoding system for visited file (default nil): ")
  (let ((coding-system-for-read coding-system))
    (revert-buffer-no-confirm)))

(defun revert-buffer-with-gbk ()
  ""
  (interactive)
  (revert-buffer-with-coding-system-no-confirm 'gbk))

(provide 'coding-settings)